﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    #region 闹钟

    /// <summary>
    /// 闹钟
    /// </summary>
    public class Clock
    {
        /// <summary>
        /// 闹钟名称
        /// </summary>
        public string ClockName { get; set; }

        /// <summary>
        /// 闹钟详细信息
        /// </summary>
        public ClockInfo clockInfo { get; set; }

        /// <summary>
        /// 打印类的信息
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append($"{clockInfo.time} {clockInfo.things}");
            return sb.ToString();
        }

    }

    /// <summary>
    /// 闹钟详细信息
    /// </summary>
    public class ClockInfo
    {
        /// <summary>
        /// 闹钟时间
        /// </summary>
        public string time { get; set; }

        /// <summary>
        /// 重复
        /// </summary>
        public string repeat { get; set; }

        /// <summary>
        /// 铃声
        /// </summary>
        public string music { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string things { get; set; }

        /// <summary>
        /// 稍后提醒
        /// </summary>
        public string nextInterval { get; set; }

        /// <summary>
        /// 闹钟音量
        /// </summary>
        public string musicVolume { get; set; }

        /// <summary>
        /// 响铃时附加震动
        /// </summary>
        public string musicPlus { get; set; }

        /// <summary>
        /// 闹钟是否启用
        /// </summary>
        public string isActive { get; set; }
    }

    /// <summary>
    /// 全局闹钟配置
    /// </summary>
    public class ClockConfig
    {
        /// <summary>
        /// 距离当前时间的最近的时间
        /// </summary>
        public string recentTime { get; set; }

        /// <summary>
        /// 闹钟集合的总数
        /// </summary>
        public string clockCount { get; set; }

        /// <summary>
        /// 闹钟集合的最大数量限制
        /// </summary>
        public string clockMaxNum { get; set; }

        /// <summary>
        /// 闹钟时显示本地天气
        /// </summary>
        public bool alarmingShowWeather { get; set; } = false;

        /// <summary>
        /// 创建桌面快捷方式
        /// </summary>
        public bool createDeskShortCut { get; set; } = false;

        /// <summary>
        /// 开机自动启动
        /// </summary>
        public bool appAutoStart { get; set; } = false;

        /// <summary>
        /// 退出时最小化
        /// </summary>
        public bool isExitToMiniMode { get; set; } = false;
    }
    #endregion

    #region 天气

    #region 百度天气返回具体信息实体

    #region 1
    public class Root
    {
        /// <summary>
        /// 访问返回的状态代码
        /// </summary>
        public int status { get; set; }
        /// <summary>
        /// 结果级
        /// </summary>
        public Result result { get; set; }
        /// <summary>
        /// 访问返回的状态信息
        /// </summary>
        public string message { get; set; }
    }
    #endregion

    #region 1.1
    public class Result
    {
        /// <summary>
        /// 天气位置信息
        /// </summary>
        public Location location { get; set; }

        /// <summary>
        /// 天气现下信息
        /// </summary>
        public Now now { get; set; }

        /// <summary>
        /// 天气信息集合
        /// </summary>
        public List<Forecasts> forecasts { get; set; }
    }

    #endregion

    #region 1.1.1
    public class Location
    {
        /// <summary>
        /// 国家
        /// </summary>
        public string country { get; set; }

        /// <summary>
        /// 省份
        /// </summary>
        public string province { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        public string city { get; set; }

        /// <summary>
        /// 城市名
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// id
        /// </summary>
        public string id { get; set; }
    }

    public class Now
    {
        /// <summary>
        /// 天气描述。例如：晴
        /// </summary>
        public string text { get; set; }

        /// <summary>
        /// 温度。单位℃
        /// </summary>
        public int temp { get; set; }

        /// <summary>
        /// 感觉
        /// </summary>
        public int feels_like { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int rh { get; set; }

        /// <summary>
        /// 风级。例如：1级
        /// </summary>
        public string wind_class { get; set; }
        /// <summary>
        /// 风向。例如：西风
        /// </summary>
        public string wind_dir { get; set; }

        /// <summary>
        /// 上传时间
        /// </summary>
        public string uptime { get; set; }
    }

    /// <summary>
    /// 1.1.1.1 天气信息
    /// </summary>
    public class Forecasts
    {
        /// <summary>
        /// 白天天气。例如：晴
        /// </summary>
        public string text_day { get; set; }

        /// <summary>
        /// 夜晚天气。例如：晴
        /// </summary>
        public string text_night { get; set; }

        /// <summary>
        /// 最高气温
        /// </summary>
        public int high { get; set; }

        /// <summary>
        /// 最低气温
        /// </summary>
        public int low { get; set; }

        /// <summary>
        /// 白天风级。例如：3~4级
        /// </summary>
        public string wc_day { get; set; }

        /// <summary>
        /// 白天风向。例如：东北风
        /// </summary>
        public string wd_day { get; set; }

        /// <summary>
        /// 夜晚风级。例如：3~4级
        /// </summary>
        public string wc_night { get; set; }

        /// <summary>
        /// 夜晚风向。例如：北风
        /// </summary>
        public string wd_night { get; set; }

        /// <summary>
        /// 日期
        /// </summary>
        public DateTime date { get; set; }
        /// <summary>
        /// 星期。例如：星期一
        /// </summary>
        public string week { get; set; }
    }

    #endregion

    #endregion

    #region 天气网返回具体信息实体
    public class ChinaWeatherInfo
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public List<Province> Provinces { get; set; } = new List<Province>();
    }

    public class Province
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public List<District> Cites { get; set; } = new List<District>();
    }

    public class District
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public List<Area> Areas { get; set; } = new List<Area>();
    }

    public class Area
    {
        public string Id { get; set; }
        public string Name { get; set; }
    }
    #endregion

    #endregion

    #region 铃声
    public class Audio
    {
        /// <summary>
        /// 文件路径
        /// </summary>
        public string musicfullPath { get; set; }
        /// <summary>
        /// 文件名：带后缀，并去掉路径
        /// </summary>
        public string musicFileName => Path.GetFileName(musicfullPath);
        /// <summary>
        /// 文件名：去掉路径并去掉后缀
        /// </summary>
        public string musicFileNameNoExten => Path.GetFileNameWithoutExtension(musicFileName);
    }
    #endregion

    #region 时间差

    public class DateTimeDiff
    {
        public int Day{ get; set; }
        public int Hour{ get; set; }
        public int Minute{ get; set; }
        public int Second{ get; set; }
    }

    #endregion
}
